The present invention relates to software applications. More specifically, the invention relates to techniques for implementing a framework for extensible applications.
The Java(trademark) programming language is an object-oriented high level programming language developed by Sun Microsystems and designed to be portable enough to be executed on a wide range of computers ranging from small devices (e.g., pagers, cell phones and smart cards) up to supercomputers. Computer programs written in Java (and other languages) can be compiled into virtual machine instructions for execution by a Java virtual machine. In general, the Java virtual machine decodes and executes the virtual machine instructions.
The virtual machine instructions for the Java virtual machine are bytecodes, meaning they include one or more bytes. The bytecodes are stored in a particular file format called a xe2x80x9cclass filexe2x80x9d that includes bytecodes for methods of a class. In addition to the bytecodes for methods of a class, the class file includes a symbol table as well as other ancillary information.
A computer program embodied as Java bytecodes in one or more class files is platform independent. The computer program can be executed, unmodified, on any computer that is able to run an implementation of the Java virtual machine. The Java virtual machine is a software emulator of a xe2x80x9cgenericxe2x80x9d computer. This is a major factor in allowing computer programs for the Java virtual machine to be platform independent.
The Java virtual machine is commonly implemented as a software interpreter. Conventional interpreters decode and execute the virtual machine instructions of an interpreted program one instruction at a time during execution, which is in contrast to compilers that decode source code into native machine instructions prior to execution so that decoding is not performed during execution. Java virtual machines can be an interpreter, utilize a compiler or a combination of the two. The Java virtual machine can be written in a programming language other than the Java programming language (e.g., the C++ programming language).
As Java programs are platform independent, they are being written for a wide variety of computing devices including small handheld devices, network personal computers (NPCs), and fully functional personal computers. Each computing device can have different storage capacity, processing power, and input/output (I/O) capabilities. It would be beneficial to have techniques for providing extensible applications or, in other words, applications that can be readily extended with new features including upgrades. Additionally, it would be beneficial to make it possible to have automatic, or almost automatic, techniques for installing an application or for extending the features of an application that has been installed.
In general, embodiments of the present invention provide innovative techniques for providing extensible applications. A bundle or software module can be developed that is able to install itself within an application. This way, it is not necessary for the user to perform a complicated installation procedure. Additionally, the software module can inform the application as to the services upon which the software module depends (e.g., thread services) so that if the required services are not available, the application can obtain them. An activation function can be defined in the software module that registers the services provided by the software module with the application so that the services can be available to other software modules. Several embodiments of the invention are described below.
In one embodiment, a computer-implemented method for providing extensible applications includes receiving a software module that is to be added to an application. The software module provides one or more services to the application. An installation function of the software module can be called that creates an execution context for the software module within the application. A dependencies function of the software module can be called that informs the application of services that are required by the software module. Additionally, an activation function of the software module can be called that registers with the application the one or more services provided by the software module. In preferred embodiments, the application is a Java program.
In another embodiment, a computer-implemented method for defining a software module includes defining a service provided by the software module. An installation function for the software module can be defined that creates a execution context for the software module within an application. A dependencies function for the software module can be defined that indicates services required by the software module. Also, an activation function for the software module can be defined that registers with the application the services provided by the software module.
Other features and advantages of the invention will become readily apparent upon review of the following detailed description in association with the accompanying drawings.